//
//  StateExampleView.swift
//  TanTan_Kotlin
//
//  Created by EDY on 5/23/25.
//

import SwiftUI

struct StateExampleView : View{
    @State private var counter = 0
    var body : some View {
        VStack {
            Text("计数器: \(counter)")
                .font(.largeTitle)
            Button(action: {
                counter += 1
            }){
                Text("增加")
                    .font(.title)
                    .padding()
                    .background(Color.blue)
                    .foregroundColor(.white)
                    .cornerRadius(10)
            }
        }
    }
}

#Preview {
    StateExampleView()
}
